package tv.geir.slackspace.event;

import java.rmi.MarshalledObject;

import net.jini.core.event.RemoteEvent;
import tv.geir.slackspace.common.ProminentObject;
import tv.geir.slackspace.matching.Template;

/**
 * 
 * @author Geir Gullestad Pettersen
 *
 */
public class SpaceEvent extends RemoteEvent {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private SpaceEventType eventType;
    private ProminentObject entry;
    private Template entryTemplate;
    
	/**
	 * @param src The object on which the Event initially occurred
	 * @param eventType The eventOccured of event that occured
	 */
	public SpaceEvent(Object source, 
                    long eventID, 
                    long seqNum, 
                    MarshalledObject handback, 
                    SpaceEventType eventType, 
                    ProminentObject entry) {
		super(source, eventID, seqNum, handback);
		this.eventType = eventType;		
	}
	
	public enum SpaceEventType{
		ENTRY_REMOVED, ENTRY_REMOVED_LEASE_EXPIRED, ENTRY_WRITTEN_TO_SPACE;
	}

    protected SpaceEventType getEventType() {
        return eventType;
    }

    protected void setEventType(SpaceEventType eventType) {
        this.eventType = eventType;
    }

    protected ProminentObject getEntry() {
        return entry;
    }

    protected void setEntry(ProminentObject entry) {
        this.entry = entry;
    }

}
